home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / os2 / nortutil.zip / src / WareZ / WareZ.c next >
C/C++ Source or Header  |  1996-08-28  |  1KB  |  51 lines

  1. /*    McElwainising filter.    version 1.02
  2.  *    Part of the Emperor Norton Utilities. All rites reversed.
  3.  *    UN-altered REPRODUCTION and COMPLIATION of this
  4.  *    IMPORTANT SOURCE CODE is ENCOURAGED (as is alteration)
  5.  *
  6.  *    Author:        acb
  7.  *    Commenced:    27-5-1993
  8.  */
  9. #include <stdlib.h>
  10. #include <stdio.h>
  11. #include <ctype.h>
  12. #include <time.h>
  13.  
  14. main() {
  15.     time_t seed;
  16.     char c;
  17.     char p='\0';
  18.     int f = 0;
  19.     time(&seed);
  20.     srand((long)seed);
  21.     while((c=getchar())!=EOF) {
  22.         char o;
  23.         f = (c==' '||c=='\n')?!f:f;
  24.         o = f?toupper(c):c;
  25.         if (((o=='S')||(o=='s'))&&(rand()>14384))
  26.             putchar('$');
  27.         else if ((o=='O')&&(isalpha(p))&&(rand()>16384))
  28.             putchar('0');
  29.         else if (((o=='K')&&(isalpha(p)))||((o=='k')&&(rand()>14000))) {
  30.             putchar(']');
  31.             putchar('<');
  32.         }
  33.         else if ((o=='I')&&(isalpha(p))&&(rand()>8000))
  34.             putchar('1');
  35.         else if ((o=='E')&&(isalpha(p))&&(rand()>11000))
  36.             putchar('3');
  37.         else if ((o=='B')&&(isalpha(p))&&(rand()>16384))
  38.             putchar('8');
  39.         else if ((o=='V')&&(isalpha(p))&&(rand()>2000)) {
  40.             putchar('\\');
  41.             putchar('/');
  42. }
  43.         else putchar(o);
  44. /*
  45.         putchar((((o=='S')&&(isalpha(p))&&(rand(10)>5))?'$')||(:o);
  46. */
  47.         p=c;
  48.     };
  49.     printf("\n\t\tPleaz Po$T s0me Kew1 WareZ Doodz.\n");
  50. };
  51.